<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/templates/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{sysAddressProvinceBean.id}"/>
		<f:event type="preRenderView" listener="#{sysAddressProvinceBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Sys Address Province"/>

	<ui:define name="header">
		Sys Address Province
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty sysAddressProvinceBean.id}">
				Edit existing Sys Address Province
			</c:when>
			<c:otherwise>
				Create a new Sys Address Province
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="sysAddressProvinceBeanSysAddressProvinceAddrProvinceCode" value="Addr Province Code:"/>
				<h:panelGroup>
					<h:inputText id="sysAddressProvinceBeanSysAddressProvinceAddrProvinceCode" maxLength="10" value="#{sysAddressProvinceBean.sysAddressProvince.addrProvinceCode}"/>
					<h:message for="sysAddressProvinceBeanSysAddressProvinceAddrProvinceCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysAddressProvinceBeanSysAddressProvinceAddrProvinceName" value="Addr Province Name:"/>
				<h:panelGroup>
					<h:inputText id="sysAddressProvinceBeanSysAddressProvinceAddrProvinceName" value="#{sysAddressProvinceBean.sysAddressProvince.addrProvinceName}"/>
					<h:message for="sysAddressProvinceBeanSysAddressProvinceAddrProvinceName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysAddressProvinceBeanSysAddressProvinceAddrRegionNo" value="Addr Region No:"/>
				<h:panelGroup>
					<h:inputText id="sysAddressProvinceBeanSysAddressProvinceAddrRegionNo" value="#{sysAddressProvinceBean.sysAddressProvince.addrRegionNo}"/>
					<h:message for="sysAddressProvinceBeanSysAddressProvinceAddrRegionNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysAddressProvinceBeanSysAddressProvinceSaleLoanContracts" value="Sale Loan Contracts:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysAddressProvinceBean.sysAddressProvince.saleLoanContracts}"/>
					<h:dataTable id="sysAddressProvinceBeanSysAddressProvinceSaleLoanContracts" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Hr Emp"/>
							</f:facet>
							<h:link outcome="/form/saleLoanContract/view">
								<f:param name="id" value="#{_item.recNo}"/>
								<h:outputText id="forgeviewdisplayitemHrEmp" value="#{forgeview:display(_item.hrEmp)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{hrEmpBean.converter}" id="saleLoanContractBeanAddHrEmp" value="#{saleLoanContractBean.add.hrEmp}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{hrEmpBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="saleLoanContractBeanAddHrEmp" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys Cust"/>
							</f:facet>
							<h:link outcome="/form/saleLoanContract/view">
								<f:param name="id" value="#{_item.recNo}"/>
								<h:outputText id="forgeviewdisplayitemSysCust" value="#{forgeview:display(_item.sysCust)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysCustBean.converter}" id="saleLoanContractBeanAddSysCust" value="#{saleLoanContractBean.add.sysCust}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysCustBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="saleLoanContractBeanAddSysCust" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys Vehicle Brand"/>
							</f:facet>
							<h:link outcome="/form/saleLoanContract/view">
								<f:param name="id" value="#{_item.recNo}"/>
								<h:outputText id="forgeviewdisplayitemSysVehicleBrand" value="#{forgeview:display(_item.sysVehicleBrand)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysVehicleBrandBean.converter}" id="saleLoanContractBeanAddSysVehicleBrand" value="#{saleLoanContractBean.add.sysVehicleBrand}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysVehicleBrandBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="saleLoanContractBeanAddSysVehicleBrand" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sale Loan Grade"/>
							</f:facet>
							<h:link outcome="/form/saleLoanContract/view">
								<f:param name="id" value="#{_item.recNo}"/>
								<h:outputText id="forgeviewdisplayitemSaleLoanGrade" value="#{forgeview:display(_item.saleLoanGrade)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{saleLoanGradeBean.converter}" id="saleLoanContractBeanAddSaleLoanGrade" value="#{saleLoanContractBean.add.saleLoanGrade}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{saleLoanGradeBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="saleLoanContractBeanAddSaleLoanGrade" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys Org"/>
							</f:facet>
							<h:link outcome="/form/saleLoanContract/view">
								<f:param name="id" value="#{_item.recNo}"/>
								<h:outputText id="forgeviewdisplayitemSysOrg" value="#{forgeview:display(_item.sysOrg)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysOrgBean.converter}" id="saleLoanContractBeanAddSysOrg" value="#{saleLoanContractBean.add.sysOrg}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="saleLoanContractBeanAddSysOrg" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(saleLoanContractBean.added)}" id="sysAddressProvinceBeanSysAddressProvinceSaleLoanContractsAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{saleLoanContractBean.add.sysAddressProvince}" value="#{sysAddressProvinceBean.sysAddressProvince}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{sysAddressProvinceBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty sysAddressProvinceBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{sysAddressProvinceBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{sysAddressProvinceBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>